Skip to content

fix(ci): retry archive readback after a transient DNS failure - #5557

Open
shepherdjerred wants to merge 1 commit into
mainfrom
ci-archive-readback-dns-transient
Open

shepherdjerred wants to merge 1 commit into
mainfrom
ci-archive-readback-dns-transient

Conversation

@shepherdjerred

@shepherdjerred shepherdjerred commented Dec 3, 2026 •

Copy link
Copy Markdown
Owner

Why

Main pipeline 21126 (5fa17ca9b9) failed tofu-archives on one DNS blip. The create-only upload of an already-published Tofu archive returned PreconditionFailed (expected), then the byte readback failed with AWS_IO_DNS_INVALID_NAME. The readback classifier treated only an unreachable endpoint and S3 internal errors as transient, so the step failed immediately instead of retrying — and a red main holds every toolkit pr land.

What

  • scripts/lib/artifacts/immutable-archive.ts: the transient readback pattern also matches download failed: … AWS_IO_DNS_*:, so the existing 5-attempt backoff (withCiObjectStoreRetry) retries it. Permanent errors (403, byte mismatch) still fail at once.
  • New fixture for a create-only conflict followed by one DNS failure.

Demo

Before — main pipeline 21126, step tofu-archives:

aws: [ERROR]: An error occurred (PreconditionFailed) when calling the PutObject operation
download failed: s3://delivery-artifacts/tofu/anthropic-federation/9784a9….tar to …/readback.tar AWS_IO_DNS_INVALID_NAME: Host name was invalid for dns resolution.
error: Immutable archive publication is unconfirmed (upload exit 254, readback exit 1)

After — the same readback stderr is classified transient and retried once (new fixture, expectedDelays: [1000]):

✓ requires exact immutable readback after create-only conflict followed by a DNS resolution failure
Tests  9 passed (9)

Against main's pattern the new fixture fails (Tests 1 failed | 8 passed).

Verification

  • cd scripts && bun --no-install --bun vitest --config ../vitest.config.ts run lib/artifacts/immutable-archive.test.ts: 9/9 pass; new case fails on main's pattern.
  • bunx lefthook run pre-commit: pass.
  • No affected workspace has extended-tier steps for this file.
  • Not run: a live tofu-archives publication.

🤖 Generated with Claude Code

Summary by CodeRabbit

  • Bug Fixes
    • Improved recovery from temporary DNS errors when reading archived objects by retrying the operation.

Why
Main pipeline 21126 (5fa17ca) failed tofu-archives: the create-only
upload of an existing Tofu archive returned PreconditionFailed as expected,
then the byte readback hit `AWS_IO_DNS_INVALID_NAME: Host name was invalid
for dns resolution`. The readback classifier only treated an unreachable
endpoint and S3 internal errors as transient, so one DNS blip failed the
step instead of retrying, and red main holds every land.

What
- The transient readback pattern also matches `download failed: ...
  AWS_IO_DNS_*:` errors, so the existing 5-attempt backoff retries them.
- New fixture: create-only conflict followed by one DNS failure retries once
  and succeeds.

Verification
- `bun --bun vitest run lib/artifacts/immutable-archive.test.ts` (scripts):
  9/9 pass; the new case fails against main's pattern (1 failed, 8 passed).
- Not run: a live tofu-archives publication.

Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
@shepherdjerred

Copy link
Copy Markdown
Owner Author

This change is part of the following stack:

Change managed by git-spice.

@greptile-apps

greptile-apps Bot commented Dec 3, 2026

Copy link
Copy Markdown
Contributor

Automatic reviews are disabled for this repository. Configure in Code Review Settings.

@coderabbitai

coderabbitai Bot commented Dec 3, 2026 •

Copy link
Copy Markdown

Explain Change →

No actionable comments were generated in the recent review.

Walkthrough

The immutable archive readback matcher now classifies AWS DNS errors as transient. A test fixture checks that a DNS resolution failure after a create-only conflict triggers one retry after 1000 ms.

Changes: Immutable archive readback

Layer / File(s) Summary
Classify and test DNS readback retries
scripts/lib/artifacts/immutable-archive.ts, scripts/lib/artifacts/immutable-archive.test.ts
AWS_TRANSIENT_READBACK now matches AWS DNS error codes. The test fixture expects one retry after 1000 ms for a DNS resolution failure.

Estimated code review effort: 2 (Simple) | ~8 minutes

Change: Bug fix

Merge Risk: Minimal · up to b6986

This makes archive publication retry transient DNS failures during readback instead of failing right away. Permanent errors still fail. No actionable merge risk remains.

Pre-merge checks: Passed 4

Check name Status Explanation
Description Check Passed Check skipped - CodeRabbit’s high-level summary is enabled.
Title check Passed The title names the main change: readback retries after a transient AWS DNS failure in the archive code. The raw summary confirms AWS_TRANSIENT_READBACK now matches AWS_IO_DNS_ codes and routes them t…
Linked Issues check Passed Check skipped because no linked issues were found for this pull request.
Out of Scope Changes check Passed Check skipped because no linked issues were found for this pull request.
Full details: Title check

Explanation

The title names the main change: readback retries after a transient AWS DNS failure in the archive code. The raw summary confirms AWS_TRANSIENT_READBACK now matches AWS_IO_DNS_ codes and routes them to withCiObjectStoreRetry, and the PR objectives describe the same DNS retry behavior. The title does not mention the new test case, which is expected.

Finishing Touches

Generate unit tests (beta)

  • Commit to this branch
  • Create a new PR
  • Autofix · Keep fixing CodeRabbit findings and required CI, and resolving merge conflicts

Thanks for using CodeRabbit! It's free for OSS, and your support helps us grow. If you like it, consider giving us a shout-out.

Share

Recent review info

Run configuration

Commits

Reviewing files that changed from the base of the PR and between 5fa17ca and b6986a9.

Files selected for processing: 2

  • scripts/lib/artifacts/immutable-archive.test.ts
  • scripts/lib/artifacts/immutable-archive.ts

Included review availability: This review used your included allowance. Your plan provides up to 1 included review per hour; 0 remain after this review.

@shepherdjerred

Copy link
Copy Markdown
Owner Author

@coderabbitai review

Automated re-review request for b6986a9 from the CI review gate.

@coderabbitai

coderabbitai Bot commented Dec 3, 2026 •

Copy link
Copy Markdown
Action performed

Review finished.

Note: CodeRabbit is an incremental review system and does not re-review already reviewed commits. This command is applicable only when automatic reviews are paused.

@shepherdjerred

Copy link
Copy Markdown
Owner Author

@coderabbitai review

Automated re-review request for b6986a9 (attempt 2 of 2) from the CI review gate.

@coderabbitai

coderabbitai Bot commented Dec 3, 2026 •

Copy link
Copy Markdown
Action not completed

Already reviewed the last commit. Use @coderabbitai full review to rerun a review of the entire changeset.

Note: CodeRabbit is an incremental review system and does not re-review already reviewed commits. This command is applicable only when automatic reviews are paused.

@shepherdjerred

Copy link
Copy Markdown
Owner Author

@codex review

Automated re-review request for b6986a9 from the CI review gate.

@chatgpt-codex-connector

chatgpt-codex-connector Bot commented Dec 3, 2026 •

Copy link
Copy Markdown
Codex Review Summary: ✅ Completed

This comment shows the latest Codex review activity on this pull request.

Review Status Commit Review trigger
📝 Code Review ✅ Completed 2026-12-03T07:26:21.177466Z b6986a9 Manual request
ℹ️ About Codex in GitHub

Your team has set up Codex to review pull requests in this repo. Reviews are triggered when you

  • Open a pull request for review
  • Mark a draft as ready
  • Comment "@codex review" or "@codex security review".

Codex reacts with 👀 while any review is running, comments if it has suggestions, and reacts with 👍 once all reviews finish with no findings.

@chatgpt-codex-connector

Copy link
Copy Markdown

Codex Review: Didn't find any major issues. More of your lovely PRs please.

Reviewed commit: b6986a9d9c

ℹ️ About Codex in GitHub

Your team has set up Codex to review pull requests in this repo. Reviews are triggered when you

  • Open a pull request for review
  • Mark a draft as ready
  • Comment "@codex review".

If Codex has suggestions, it will comment; otherwise it will react with 👍.

Codex can also answer questions or update the PR. Try commenting "@codex address that feedback".

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant